home *** CD-ROM | disk | FTP | other *** search
- Path: tank.news.pipex.net!pipex!demon!le-vamp.demon.co.uk
- From: Kurt@le-vamp.demon.co.uk (Kurt Frary)
- Newsgroups: comp.lang.c++
- Subject: Can anyone explain ?
- Date: Fri, 09 Feb 1996 23:15:10 GMT
- Message-ID: <823907577.10880@le-vamp.demon.co.uk>
- Reply-To: kurt@le-vamp.demon.co.uk
- NNTP-Posting-Host: le-vamp.demon.co.uk
- X-NNTP-Posting-Host: le-vamp.demon.co.uk
- X-Newsreader: Forte Agent .99c/32.126
-
- I know this isn't neccessarily the correct group, but everyone here
- seems to be real coders.
-
- I can code, cobol, Assembler, (Amiga and PC fairly well), e.t.c
- e.t.c.
-
-
- Can someone shed some light on this piece of code, I have just started
- using Watcom C++ Dos4Gw, Flat model and all that
-
- What I want to know is the following
-
- A) can someone give me some decent comments for the code ?
-
- B) What the difference between
- Regs.w.ax - I have only a guess that this will load ax with
- whatever 32 bit code, or am I being a lamer ?
- and Regs.h.bl - Load bl with whatever 16 bit ?
-
- C) How do i know how many parameters to pass to int386x ? i.e. Sregs,
- regs e.t.c.
-
-
-
- As you can see I have already worked out how to pass screen modes
- e.t.c. probably haven't got a clue though.....
-
-
- P.S. Thanks to everyone in the group for all the help I have had, I am
- already adding things to the F.A.Q about intergrating Watcom with
- Tasm.
-
-
- #include <i86.h>
- #include <dos.h>
- #include <stdio.h>
- #include <string.h>
-
- static struct rminfo {
- long EDI;
- long ESI;
- long EBP;
- long reserved_by_system;
- long EBX;
- long EDX;
- long ECX;
- long EAX;
- short flags;
- short ES,DS,FS,GS,IP,CS,SP,SS;
- } RMI;
-
- void scrmode(char scrmode)
- {
- union REGS regs;
- struct SREGS sregs;
- int interrupt_no=0x31;
-
- /* Set up real-mode call structure */
- memset(&RMI,0,sizeof(RMI));
-
- RMI.EAX=scrmode; /* call service 00h ah=0x39 and pass in Al 13 or
- 0D */
-
- /* Use DMPI call 300h to issue the DOS interrupt */
- regs.w.ax = 0x0300;
- regs.h.bl = 0x10;
- sregs.es = FP_SEG(&RMI);
- regs.x.edi = FP_OFF(&RMI);
- int386x( interrupt_no, ®s, ®s, &sregs );
-
- MM MM A SS K K EEE RR
- M M M A A S K K E R R
- M M AAA S KK EEE RR
- M M A A S K K E R R
- M M A A SS K K EEE R R :)
-
-